'''
Project:      World Exposition
Name:         redneck.py
Purpose:      a playable character

Authors:      Sam Milender, Calvin Berger
Main Author:  Sam Milender

Created:      4/30/13
Copyright:    (c) Sam Milender 2013
Licence:      New BSD
-----------------------------------------------------------------------------
'''

import pygame, math

class Bullet(pygame.sprite.Sprite):
    def __init__(self, image, speed, position, dir, screenSize, playerScrolling, realplace):
        pygame.sprite.Sprite.__init__(self, self.containers)
        self.image = pygame.image.load(image)
        self.rect = self.image.get_rect()
        self.speed = speed
        self.XmaxSpeed = 100
        self.realx = position[0]
        self.realy = position[1]
        self.living = True
        self.didHit = False
        self.screenSize = self.screenWidth, self.screenHeight = screenSize
        self.scrollingX = False
        self.scrollingY = False
        self.scrollThreshold = 200
        self.playerScrolling = playerScrolling
        self.realPlace = realplace

    
    def place(self, position):
        self.rect.center = position
        
        
    def move(self):
#        if self.speed[1] > 0
        if self.playerScrolling[0] == True:
            self.realx = self.realPlace[0]
        if self.playerScrolling[1] == True:
            self.realy = self.realPlace[1]
        else:
            self.realx += self.speed[0]
            self.realy += self.speed[1]
        self.place([self.realx, self.realy])

    def update(*args):
        self = args[0]
        self.didHit = False
        if not self.living:
            self.kill()
        self.move()